/**
 * 
 */
package se.chalmers.spexet.booking.common;

/**
 * @author Winquman
 *
 */
public abstract class Version {
	public final int major;
	public final int minor;
	public final int revision;
	
	public Version (int major, int minor, int revision) {
		this.major = major;
		this.minor = minor;
		this.revision = revision;
	}
	
	public boolean compatable(Version v) {
		if(major == v.major)
			if(minor == v.minor)
				return true;
		return false;
	}
	
	public boolean exact(Version v) {
		if(major == v.major)
			if(minor == v.minor)
				if(revision == v.revision)
					return true;
		return false;
	}
	
	public boolean equals(Version v) {
		return compatable(v);
	}
	
	public String toString() {
		return "" + major + "." + minor + "." + revision;
	}
}
